package com.bjtang.book.dto;

import java.time.LocalDateTime;

import javax.validation.constraints.Null;

import org.hibernate.validator.constraints.Length;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.Data;

@Data
public class ShareDto {
	// 主键
	@TableId(type = IdType.AUTO)
	private Long shareNumber;
	// 文章编号
	private Long articleNumber;
	// 文章标题
	@Length(min = 0, max = 120)
	private String title;
	// 文章简介
	@Length(min = 0, max = 1000)
	private String summary;
	// 分享感言
	@Length(min = 0, max = 500)
	private String shareFeeling;
	// 创建者ID
	@Null
	private Long founder;
	@Null
	private String founderName;

	// 创建时间
	@Null
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private LocalDateTime creationTime;
	
//	public void setShare(ShareTable shareTable) {
//		this.shareNumber  = shareTable
////		this.articleNumber = articleHead.getArticleNumber();
////		this.bookNumber = articleHead.getBookNumber();
////		this.creationTime = articleHead.getCreationTime();
////		this.deleted = articleHead.getDeleted();
////		this.downNumber = articleHead.getDownNumber();
////		this.founder = articleHead.getFounder();
////		this.pictureUrl = articleHead.getPictureUrl();
////		this.recommendNumber = articleHead.getRecommendNumber();
////		this.status = articleHead.getStatus();
////		this.summary = articleHead.getSummary();
////		this.title = articleHead.getTitle();
////		this.traffic = articleHead.getTraffic();
////		this.upNumber = articleHead.getUpNumber();
//	}
//
//	public void setBody(ArticleBody articleBody) {
//		this.articleNumber = articleBody.getArticleNumber();
//		this.content = articleBody.getContent();
//		this.updateBy = articleBody.getUpdateBy();
//		this.updateTime = articleBody.getUpdateTime();
//	}
}
